/*
 * 컴파일을 위해 올려 놓은 소스 입니다.
 * 서버에 반영하지 마시고 다른국가에 적용할 경우 서버에 있는 class 를 카피해서 사용하십시오.
 * 
 */
/*
 * Created on 2004. 10. 4.
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package com.pushmsg.OmaOtaConf;

import com.pushmsg.OmaOtaConf.OmaOtaObject.BOOTSTRAP;
import com.pushmsg.OmaOtaConf.OmaOtaObject.MMS;
import com.pushmsg.OmaOtaConf.OmaOtaObject.NAPDEF;
import com.pushmsg.OmaOtaConf.OmaOtaObject.PXLOGICAL;
/**
 * @author dgchun
 *
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public class OmaOtaMms  extends OmaOtaBody
{	
	private MMS mms = null;
	private PXLOGICAL proxy = null;
	private String profileName = null;
	
	public OmaOtaMms(int otatype)
	{
		super(otatype);		
	}
	
	public int getOtaType()
	{
		return super.getOtaType();
	}
	
	public void setProfileName(String name)
	{
		profileName = name;
	}
	
	public MMS getBrowser()
	{
		return mms;
	}
	
	//country = ger, operator=t-mobile, nettype=internet or wap
	public void setNapDef(String country, String operator, String bearer, String nettype)
	{
		bs = new BOOTSTRAP("MMS Setting");
		napDef = new NAPDEF(country, operator, "mms", bearer, nettype);
	
		proxy = new PXLOGICAL(country, operator, "mms", bearer, nettype, napDef.getNapId());
		proxy.setProxyName(profileName);
		mms = new MMS(proxy.getProxyId(), country, operator, bearer, nettype);
		mms.setName(profileName);
	}
	
	public void process()
	{
		data[length++] = (byte)0x03; //WBXML version 1.3
		data[length++] = (byte)0x0B; //Public Identifier for ��-//WAPFORUM//DTD PROV 1.0//EN��
		data[length++] = (byte)0x6A; //Character set UTF-8
		data[length++] = (byte)0x00; //String table length
		//<wap-provisioningdoc version="1.0">
		data[length++] = (byte)0xC5; 
		data[length++] = (byte)0x46; 
		data[length++] = (byte)0x01;
		
		//length += bs.getData(data, length);
		length += proxy.getData(data, length);
		length += napDef.getData(data, length);
		length += mms.getData(data, length);
		
		data[length++] = (byte)0x01; //end of wap-provisioning
	}
}

